﻿<html dir="LTR" xmlns:ndoc="urn:ndoc-schema">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="history" name="save" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>InputDevice.StopReceiving Method</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />
  </head>
  <body id="bodyID" class="dtBODY">
    <div id="nsbanner">
      <div id="bannerrow1">
        <table class="bannerparthead" cellspacing="0">
          <tr id="hdr">
            <td class="runninghead">A MIDI Library for .NET</td>
            <td class="product">
            </td>
          </tr>
        </table>
      </div>
      <div id="TitleRow">
        <h1 class="dtH1">InputDevice.StopReceiving Method</h1>
      </div>
    </div>
    <div id="nstext">
      <p> Stops this input device from receiving messages. </p>
      <div class="syntax">public <a href="">void</a> StopReceiving();</div>
      <h4 class="dtH4">Remarks</h4>
      <p>This method waits for all in-progress input event handlers to finish, and then joins (shuts down) the background thread that was created in <a href="Midi~Midi.InputDevice.StartReceiving.html">StartReceiving</a>. Thus, when this function returns you can be sure that no more event handlers will be invoked.</p>
      <p>It is illegal to call this method from an input event handler (ie, from the background thread), and doing so throws an exception. If an event handler really needs to call this method, consider using BeginInvoke to schedule it on another thread.</p>
      <h4 class="dtH4">Exceptions</h4>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
          <tr valign="top">
            <th width="50%">Exception Type</th>
            <th width="50%">Condition</th>
          </tr>
          <tr valign="top">
            <td width="50%">
              <a href="http://msdn.microsoft.com/en-us/library/System.InvalidOperationException(VS.90).aspx">InvalidOperationException</a>
            </td>
            <td width="50%">The device is not open; is not receiving; or called from within an event handler (ie, from the background thread).</td>
          </tr>
          <tr valign="top">
            <td width="50%">
              <a href="Midi~Midi.DeviceException.html">DeviceException</a>
            </td>
            <td width="50%">The device cannot start receiving.</td>
          </tr>
        </table>
      </div>
      <h4 class="dtH4">See Also</h4>
      <p>
        <a href="Midi~Midi.InputDevice.html">InputDevice Class</a> | <a href="~Midi.html">Midi Namespace</a></p>
      <hr />
      <div id="footer">
        <p>
          <a>Copyright © 2009 Tom Lokovic</a>
        </p>
        <p>Generated from assembly Midi [1.1.0.0] by <a href="http://ndoc3.sourceforget.net">NDoc3</a></p>
      </div>
    </div>
  </body>
</html>